﻿using System;
using System.IO;
using Microsoft.Extensions.Configuration;
using System.Reflection;

namespace structural_Pattern
{
    class Program
    {
        static void Main(string[] args)
        {
            var cfgBuilder = new ConfigurationBuilder();
            cfgBuilder.SetBasePath(Directory.GetCurrentDirectory());
            cfgBuilder.AddJsonFile("Project.json");
            string adapterType = cfgBuilder.Build().GetSection("Appsettings")["adapter"];
            Console.WriteLine(adapterType);
            IScoreOpe ope = Assembly.Load("structural_Pattern").CreateInstance(adapterType) as operationAdapter;
            int[] scores = { 91, 76, 52, 69, 90, 91, 88, 96 };
            int[] result;
            int score;
            Console.WriteLine("成绩排序");
            result = ope.sort(scores);
            foreach (int  item in result)
            {
                Console.WriteLine(item);
            }
            Console.WriteLine("Hello World!");
        }
    }

    
}
